package com.wash.shoes.domain.dto;

import com.ruoyi.common.core.domain.model.BaseModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 获取水洗码的请求
 */
@Data
public class GetWashCodeDto extends BaseModel {
    @ApiModelProperty(value = "类型 1.物品  2配饰")
    @Pattern(regexp = "^[1-2]$", message = "type只能是1.物品/2配饰")
    private String type;
    @ApiModelProperty(value = "门店id")
    @NotNull(message = "shopId不能为空")
    private String shopId;
    @ApiModelProperty(value = "订单id")
    @NotNull(message = "订单id不能为空")
    private String orderId;

    /**
     * 判断是否是配饰
     *
     * @return
     */
    public boolean isAccessories() {
        return "2".equals(type);
    }
}
